package com.ruoyi.safe.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.safe.mapper.EmergencyRescueMapper;
import com.ruoyi.safe.domain.EmergencyRescue;
import com.ruoyi.safe.service.IEmergencyRescueService;

/**
 * 应急物资和人员Service业务层处理
 * 
 * @author yxf
 * @date 2021-08-10
 */
@Service
public class EmergencyRescueServiceImpl implements IEmergencyRescueService 
{
    @Autowired
    private EmergencyRescueMapper emergencyRescueMapper;

    /**
     * 查询应急物资和人员
     * 
     * @param erId 应急物资和人员ID
     * @return 应急物资和人员
     */
    @Override
    public EmergencyRescue selectEmergencyRescueById(Long erId)
    {
        return emergencyRescueMapper.selectEmergencyRescueById(erId);
    }

    /**
     * 查询应急物资和人员列表
     * 
     * @param emergencyRescue 应急物资和人员
     * @return 应急物资和人员
     */
    @Override
    public List<EmergencyRescue> selectEmergencyRescueList(EmergencyRescue emergencyRescue)
    {
        return emergencyRescueMapper.selectEmergencyRescueList(emergencyRescue);
    }

    /**
     * 新增应急物资和人员
     * 
     * @param emergencyRescue 应急物资和人员
     * @return 结果
     */
    @Override
    public int insertEmergencyRescue(EmergencyRescue emergencyRescue)
    {
        emergencyRescue.setCreateTime(DateUtils.getNowDate());
        return emergencyRescueMapper.insertEmergencyRescue(emergencyRescue);
    }

    /**
     * 修改应急物资和人员
     * 
     * @param emergencyRescue 应急物资和人员
     * @return 结果
     */
    @Override
    public int updateEmergencyRescue(EmergencyRescue emergencyRescue)
    {
        emergencyRescue.setUpdateTime(DateUtils.getNowDate());
        return emergencyRescueMapper.updateEmergencyRescue(emergencyRescue);
    }

    /**
     * 批量删除应急物资和人员
     * 
     * @param erIds 需要删除的应急物资和人员ID
     * @return 结果
     */
    @Override
    public int deleteEmergencyRescueByIds(Long[] erIds)
    {
        return emergencyRescueMapper.deleteEmergencyRescueByIds(erIds);
    }

    /**
     * 删除应急物资和人员信息
     * 
     * @param erId 应急物资和人员ID
     * @return 结果
     */
    @Override
    public int deleteEmergencyRescueById(Long erId)
    {
        return emergencyRescueMapper.deleteEmergencyRescueById(erId);
    }
}
